const Koa = require("koa");
const proxy = require("koa2-proxy-middleware");
const bodyparser = require("koa-bodyparser");
const cors = require("koa2-cors");

const app = new Koa();
app.use(cors());

app.use(
  proxy({
    targets: {
      // (.*) means anything
      "(.*)": {
        target: "http://150.158.185.125:29090",
        changeOrigin: true,
      },
    },
  })
);

app.use(
  bodyparser({
    enableTypes: ["json", "form", "text"],
  })
);

app.listen(19000);
